<template>
  <Wrapper>
    <el-alert
      title="更多参数查看源代码"
      type="success"
      :closable="false"
    />
    <captcha-input
      ref="captchaRef"
      :length="6"
      @complete="getValue"
    />
    <el-button
      type="primary"
      @click="clickValue"
    >获取值</el-button>
  </Wrapper>
</template>

<script setup>
import { ElMessage } from 'element-plus'
import CaptchaInput from '@/components/captcha-input'

const captchaRef = ref(null)

function getValue(value) {
  ElMessage.success('验证码：' + value)
}

function clickValue() {
  ElMessage.success('验证码：' + captchaRef.value.getValue())
}
</script>
